package project.hulpPakket;

import static org.junit.Assert.fail;

import org.junit.Test;

public class Vector3fTest {

	@Test
	public void test() {
		crossProductTest();
		normalizeTest();
		multiplyTest();
	}

	private void normalizeTest() {
		Vector3f v = new Vector3f(3,0,0);
		System.out.println(v.toString());
		v=v.normalise();
		System.out.println(v.toString());
	}

	private void crossProductTest() {
		Vector3f v1 = new Vector3f(1,0,0);
		Vector3f v2 = new Vector3f(0,1,0);
		Vector3f v3 = Vector3f.cross(v1, v2);
		if(v3.x != 0 || v3.y != 0 || v3.z !=1) fail("incorrect cross-prod");
		Vector3f v4 = Vector3f.Plus(Vector3f.cross(v2, v1),v3);
		if(v4.x != 0 || v4.y != 0 || v4.z !=0) fail("incorrect cross-prod");
		
	}
	
	private void multiplyTest() {
		Vector3f v1 = new Vector3f(1,0,0);
		Vector3f v2 = v1.multiply(2);
		System.out.println(v1.toString());
		System.out.println(v2.toString());
	}

}
